/**
 * Form used for search Cells
 */
Ext.define('Sisconsolid.view.cell.search.Form', {
    extend: 'Ext.form.Panel',
    alias: 'widget.cell.search.form',
    requires: [
        'Ext.form.FieldSet',
		'Ext.form.FieldContainer',
        'Ext.form.field.Text',
		'Sisconsolid.store.Families'
    ],
    bodyPadding: 5,
    initComponent: function() {
        var me = this;
        Ext.applyIf(me, {
            fieldDefaults: {
                allowBlank: true,
                labelAlign: 'top',
                flex: 1,
                margins: 5
            },
            defaults: {
                layout: 'hbox',
                margins: '0 10 0 10'                
            },
            items: [
                {
                    xtype: 'fieldset',
					title: translations.cellFilters,
					items: [
                        {
							xtype: 'fieldcontainer',
							layout: 'anchor',
							flex: 2.5,
							items: [
								{
									xtype: 'textfield',
									name: 'firstName',
									fieldLabel: translations.firstName,
									anchor: '100%'
								},
								{
									xtype: 'textfield',
									name: 'lastName',
									fieldLabel: translations.lastName,
									anchor: '100%'
								},
								{
									xtype: 'combobox',
									name: 'family',
									fieldLabel: translations.family,
									store: {
										type: 'family'
									},
									valueField: 'key',									
									displayField: 'value',
									editable: false,
									anchor: '100%'
								}
							]
						},
						{
							xtype: 'fieldcontainer',
							layout: 'anchor',
							flex: 3,
							items: [
								{
									xtype: 'ux.form.field.remotecombobox',
									name: 'idProvince',
									fieldLabel: translations.province,
									store: {
										type: 'address.province'
									},
									valueField: 'key',									
									displayField: 'value',
									editable: false,
									forceSelection: true,
									anchor: '100%'
								},
								{
									xtype: 'combobox',
									name: 'idCity',
									fieldLabel: translations.city,
									store: {
										type: 'address.city',
									},
									valueField: 'key',									
									displayField: 'value',
									editable: false,
									forceSelection: true,
									anchor: '100%'
								},
								{
									xtype: 'ux.form.field.remotecombobox',
									name: 'idNeighborhood',
									fieldLabel: translations.neighborhood,
									store: {
										type: 'address.neighborhood'
									},
									valueField: 'key',									
									displayField: 'value',
									editable: false,
									forceSelection: true,
									anchor: '100%'
								}
							]
						}
                    ]
                }
            ]
        });
        me.callParent( arguments );
    }
});